<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>系统通知</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">
</head>
<body>
<!-- 导航 -->
<nav th:replace="_fragments :: menu(5)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">小圳博客</h2>
            <link rel="shortcut icon" href="../static/image/关于我.jpg" type="image/x-icon">
            <a href="#" class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="idea icon"></i>分类</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="clone icon"></i>归档</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="info icon"></i>关于我</a>
            <div class="right m-item m-mobile-hide menu">
                <div class="centre m-item right item m-mobile-hide">
                    <div class="ui icon input">
                        <input type="text" placeholder="Search..."/>
                        <i class="search link icon"></i>
                    </div>
                </div>
            </div>
            <a href="#" class="m-item item m-mobile-hide"><i class="info icon"></i>注册</a>
        </div>
        <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
            <i class="sidebar icon"></i>
        </a>
    </div>
</nav>
<!--中间内容-->
<div class="m-container-big m-padded-tb-super-big animated fadeIn">
    <div class="ui container">
        <div class="ui stackable grid">
            <div class="five wide column">
                <div class="ui info message">
                    <div class="ui container">
                        <a href="#" th:href="@{/message/0}">
                            <div class="ui message" style="height: 60px;">
                                <div class="item">
                                    <div class="content">
                                        <div class="ui teal header"><i class="comment icon"></i>评论</div>
                                        <!--                                        <div class="extra">10 分钟前</div>-->
                                    </div>
                                </div>
                            </div>
                        </a>
                        <a href="#" th:href="@{/message/1}">
                            <div class="ui message" style="height: 60px;">
                                <div class="item">
                                    <div class="content">
                                        <div class="ui teal header"><i class="at icon"></i>回复</div>
                                        <!--                                        <div class="extra">10 分钟前</div>-->
                                    </div>
                                </div>
                            </div>
                        </a>

                        <a href="#" th:href="@{/message/2}">
                            <div class="ui message" style="height: 60px;">
                                <div class="item">
                                    <div class="content">
                                        <div class="ui teal header"><i class="thumbs up outline icon"></i>点赞</div>
                                        <!--                                        <div class="extra">30 分钟前</div>-->
                                    </div>
                                </div>
                            </div>
                        </a>

                    </div>
                </div>
            </div>
            <div class="eleven wide column">
                <div class="ui info message" style="height: 600px;" th:if="${messageType == 0}">
                    <div class="ui top attached segment">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <h3 class="ui teal header">评论</h3>
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/message/delete/{messageType}(messageType=${messageType})}"
                                   class="ui m-inline-block m-text-thin"> <i class="trash icon"></i>清空所有消息</a>
                            </div>
                        </div>
                    </div>
                    <div class="ui segment">
                        <div class="ui relaxed divided list" style="height: 500px; overflow: auto;">
                            <div class="item" th:each="event : ${events}">
                                <img class="ui avatar image" style="width: 45px;height: 45px"
                                     th:src="${event.data.headerUrl}"
                                >
                                <div class="content">
                                    <div class="ui teal header" th:text="${event.data.nickname}"
                                         style="display: inline-block;">小圳
                                    </div>
                                    <span style="display: inline-block;">评论了你的博客</span>
                                    <div class="description" th:text="${event.data.content}">点点关注不迷路</div>
                                    <div>
                                        回复来源：
                                        <a href="#" th:href="@{/blog/{id}(id=${event.data.blogId})}">
                                            <span th:text="${event.data.blogTitle}">博客标题</span></a>
                                    </div>
                                </div>
                                <div class="extras" style="float: right;">
                                    <span th:text="${#dates.format(event.data.createTime,'yyyy-MM-dd')}">2021-10-15</span>
                                    <a th:href="@{/message/delete/{entityType}/{eventId}(entityType=${event.entityType},eventId=${event.id})}">
                                        <i class="trash icon"></i></a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ui info message" style="height: 600px;" th:if="${messageType == 1}">
                    <div class="ui top attached segment">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <h3 class="ui teal header">回复</h3>
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/message/delete/{messageType}(messageType=${messageType})}"
                                   class="ui m-inline-block m-text-thin"> <i class="trash icon"></i>清空所有消息</a>
                            </div>
                        </div>
                    </div>
                    <div class="ui segment">
                        <div class="ui relaxed divided list" style="height: 500px; overflow: auto;">
                            <div class="item" th:each="event : ${events}">
                                <img class="ui avatar image" style="width: 45px;height: 45px"
                                     th:src="${event.data.headerUrl}"
                                >
                                <div class="content">
                                    <div class="ui teal header" th:text="${event.data.nickname}"
                                         style="display: inline-block;">小圳
                                    </div>
                                    <span style="display: inline-block;">回复了你的评论</span>
                                    <div class="description" th:text="${event.data.content}">点点关注不迷路</div>
                                    <div>
                                        回复来源：
                                        <a href="#" th:href="@{/blog/{id}(id=${event.data.blogId})}">
                                            <span th:text="${event.data.blogTitle}">博客标题</span></a>
                                    </div>
                                </div>
                                <div class="extras" style="float: right;">
                                    <span th:text="${#dates.format(event.data.createTime,'yyyy-MM-dd')}">2021-10-15</span>
                                    <a th:href="@{/message/delete/{entityType}/{eventId}(entityType=${event.entityType},eventId=${event.id})}">
                                        <i class="trash icon"></i></a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="ui info message" style="height: 600px;" th:if="${messageType == 2}">
                    <div class="ui top attached segment">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <h3 class="ui teal header">点赞</h3>
                            </div>
                        </div>
                    </div>

                    <div class="ui segment">
                        <div class="ui relaxed divided list">
                            <div class="item">
                                <img class="ui avatar image"
                                     src="https://semantic-ui.com/images/avatar/small/helen.jpg">
                                <div class="content">
                                    <a class="header">小圳 <span>点赞了你</span></a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<!-- 底部 -->
<footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive">
    <div class="ui center aligned container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/image/小圳微信.png" class="ui m-margin-top rounded image" alt=""/>
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">最新博客</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">莫欺少年穷</a>
                    <a href="#" class="item">莫欺中年穷</a>
                    <a href="#" class="item">莫欺老年穷</a>
                    <a href="#" class="item">死者为大</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">联系我</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">Email：2796830992@qq.com</a>
                    <a href="#" class="item">QQ：2796830992</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">最新博客</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">小圳博客主要分享计算机相关技术和一些有趣的事情哦！</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">xiaozhen-blog 2023.4.10</p>
    </div>
</footer>
</div>

<!--/*/<th:block th:replace="_fragments :: script">/*/-->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
<!--/*/</th:block>/*/-->

<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });
    $('.ui.dropdown').dropdown({
        on: 'hover'
    });

    // 点击 评论与@ 后要进行的逻辑处理
    function comment() {
        var commentId = $(obj).data('commentid'); // 给后端传输评论 id
        var commentNickname = $(obj).data('commentnickname'); // 给后端传输要回复的评论的发布者的名称
        $("[name='content']").attr("placeholder", "@" + commentNickname).focus(); // 渲染发布内容
        $("[name='parentCommentId']").val(commentId); // 修改隐藏域中父评论的评论 id
        $(window).scrollTo($('#comment-form'), 600); // 动画效果
    }
</script>
</body>
</html>